package net.itfenxiang.mybatisplus.service.impl;

import lombok.AllArgsConstructor;
import net.itfenxiang.mybatisplus.dao.UserDao;
import net.itfenxiang.mybatisplus.entity.UserEntity;
import net.itfenxiang.mybatisplus.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description: TODO
 * @author: 墨凡
 * @date: 2024/4/28 16:19
 * @version: 1.0
 */
@Service
@AllArgsConstructor
public class UserServiceImpl implements UserService {
    private final UserDao userDao;


    @Override
    public UserEntity getUser(Long id) {
        return userDao.selectById(id);
    }

    @Override
    public List<UserEntity> getUserList() {
        return userDao.selectList(null);
    }

    @Override
    public void update(UserEntity user) {
        userDao.updateById(user);
    }
}
